<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet"  href="/static/plugins/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet"  href="/static/plugins/font-awesome/css/font-awesome.min.css"/>
    <link rel="stylesheet"  href="/static/css/commons.css"/>
    <link rel="stylesheet"  href="/static/css/account.css"/>
</head>
<body>

    <div class="login-container">
        <div class="account-body clearfix">

            <div class="logo left">
                <img style='height:100%;width: 100%;' src="/static/images/login.png" />
            </div>

            <div class="form left">

                <div style="margin: 10px 60px 0 60px;">

                    <form id="Form" method="POST" action="/cmdb/login/">

                        {% if error %}
                         <div class="alert alert-danger" role="alert">
                              <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                              <span class="sr-only">Error:</span>
                              {{ error }}
                         </div>
                        {% else %}
                            <div style="height: 30px;">&nbsp;</div>
                        {% endif %}


                         <div class="input-group">
                             <span class="input-group-addon"><i class="fa fa-user"></i></span>
                             {{ model.username }}

                        </div>
                        <div class="input-group">
                             <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                            {{ model.password }}
                        </div>
                        <div class="input-group">
                             <span class="input-group-addon"><i class="fa fa-pencil-square-o"></i></span>
                             <input type="text" name="checkcode" class="form-control check-code" placeholder="验证码">
                             <img onclick='ChangeCode();' id='imgCode' src="/account/checkcode/">

                        </div>
                        <div class="input-group">
                             <span  class="check"><input type="checkbox" ></span>
                            <span>自动登录</span>
                            <span style="margin-left: 50px"><a href="#">忘记密码</a></span>
                        </div>

                        <div class="input-group">
                            <input type="submit" class="btn btn-primary" value="登 陆" />
                            <input type="reset" class="btn btn-primary" value="重 置" />
                            <a href="/cmdb/register/" style="color: red;float: right;margin: -18px 14px;">立即注册>>></a>
                            <div style="color: red" >{{ status }}</div>
                        </div>

                    </form>
                </div>


            </div>
        </div>
    </div>
    <script src='/static/js/jquery-1.8.2.min.js'></script>
	<script src='/static/js/valid.js'></script>
    <script type="text/javascript">

    	$(function(){
    		$.login('#Form','');
    	});

    function ChangeCode() {
        var code = document.getElementById('imgCode');
        code.src += '?';
    }
</script>
</body>
</html>